import React from 'react';
export function createLeggoItems(selectedStore) {
  var result = [];
  console.log('create item: ', selectedStore);
  if (JSON.stringify(selectedStore) !== '{}') {
    var handleDragStart = function (e) {
      var schemaType = e.target.dataset.type;
      e.dataTransfer.setData('text/plain', schemaType);
    };
    for (var _i = 0, _a = Object.values(selectedStore); _i < _a.length; _i++) {
      var value = _a[_i];
      var type = value.type,
        StandardInput = value.StandardInput,
        configs = value.configs,
        hidden = value.hidden;
      var item = React.createElement(
        'div',
        {
          key: type,
          className: 'item',
          draggable: true,
          onDragStart: handleDragStart,
          'data-type': type,
          style: { display: hidden ? 'none' : 'block' }
        },
        React.createElement('div', { className: 'item-forbidden' }, configs.itemProps.label || type)
      );
      result.push(item);
    }
  }
  return result;
}
